﻿using System.Collections.Generic;
using System.Data;
namespace WPFExcelReport
{
    public partial class VMEKOPF
    {
        VAMSTAMM _AM;
        public VAMSTAMM AM
        {
            get
            {
                if (_AM == null) _AM = new VAMSTAMM();
                return _AM;
            }
        }
        VMEVAR _AE05;
        public VMEVAR AE05
        {
            get
            {
                if (_AE05 == null) _AE05 = new VMEVAR();
                return _AE05;
            }
        }
        public void Insert(DataRow _dwAPK)
        { 
            InsertMEKOPF(_dwAPK, app.company);
            TBMain.Rows.InsertAt(_dwAPK, 0);
        } 
        public void DELAE(Dictionary<string,object> pm)
        {
            dwData = TBMain.NewRow();
            dwData["MEKMANDANT"] = app.Mandant;
            dwData["MEKMNRKRS"]  = pm["MEKMNRKRS"] ;
            dwData["MEKMLFDNR"]  = pm["MEKMLFDNR"] ;
            dwData["MEKMPOS"]    = pm["MEKMPOS"];
            dwData["MEKAGANG"] = pm["MEKAGANG"];
            dwData["MEKMTYP"] = pm["MEKMTYP"];
            dwData["MEKEVARHNR"] = pm["MEKEVARHNR"];
            dwData["MEKEVARUNR"] = pm["MEKEVARUNR"];
            DMAE01(dwData);
            AE05.DELAE05(pm);
        }
    }
    public partial class VMEKOPF
    {
        public string MEKAGANG { get { if (dwMaster == null) return ""; return dwMaster["MEKAGANG"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKAGANG"] = value; OnPropertyChanged("MEKAGANG", value); } } //lENGth 15
        public string MEKMTYP { get { if (dwMaster == null) return ""; return dwMaster["MEKMTYP"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMTYP"] = value; OnPropertyChanged("MEKMTYP", value); } } //lENGth 8
        public string MEKMNRKRS { get { if (dwMaster == null) return ""; return dwMaster["MEKMNRKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMNRKRS"] = value; OnPropertyChanged("MEKMNRKRS", value); } } //lENGth 2
        public string MEKMLFDNR { get { if (dwMaster == null) return ""; return dwMaster["MEKMLFDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMLFDNR"] = value; OnPropertyChanged("MEKMLFDNR", value); } } //lENGth 4
        public string MEKMPOS { get { if (dwMaster == null) return ""; return dwMaster["MEKMPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMPOS"] = value; OnPropertyChanged("MEKMPOS", value); } } //lENGth 2
        public string MEKEVARHNR { get { if (dwMaster == null) return ""; return dwMaster["MEKEVARHNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKEVARHNR"] = value; OnPropertyChanged("MEKEVARHNR", value); } } //lENGth 2
        public string MEKEVARUNR { get { if (dwMaster == null) return ""; return dwMaster["MEKEVARUNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKEVARUNR"] = value; OnPropertyChanged("MEKEVARUNR", value); } } //lENGth 2
        public string MEKBEM1 { get { if (dwMaster == null) return ""; return dwMaster["MEKBEM1"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBEM1"] = value; OnPropertyChanged("MEKBEM1", value); } } //lENGth 50
        public string MEKBEM2 { get { if (dwMaster == null) return ""; return dwMaster["MEKBEM2"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBEM2"] = value; OnPropertyChanged("MEKBEM2", value); } } //lENGth 50

        #region======ColumnSchema==========
        /*
                 public string MEKMANDANT { get { if (dwMaster == null) return ""; return dwMaster["MEKMANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMANDANT"] = value; OnPropertyChanged("MEKMANDANT", value); } } //lENGth 2
                 public string MEKAGANG { get { if (dwMaster == null) return ""; return dwMaster["MEKAGANG"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKAGANG"] = value; OnPropertyChanged("MEKAGANG", value); } } //lENGth 15
                 public string MEKMTYP { get { if (dwMaster == null) return ""; return dwMaster["MEKMTYP"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMTYP"] = value; OnPropertyChanged("MEKMTYP", value); } } //lENGth 8
                 public string MEKMNRKRS { get { if (dwMaster == null) return ""; return dwMaster["MEKMNRKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMNRKRS"] = value; OnPropertyChanged("MEKMNRKRS", value); } } //lENGth 2
                 public string MEKMLFDNR { get { if (dwMaster == null) return ""; return dwMaster["MEKMLFDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMLFDNR"] = value; OnPropertyChanged("MEKMLFDNR", value); } } //lENGth 4
                 public string MEKMPOS { get { if (dwMaster == null) return ""; return dwMaster["MEKMPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKMPOS"] = value; OnPropertyChanged("MEKMPOS", value); } } //lENGth 2
                 public string MEKEVARHNR { get { if (dwMaster == null) return ""; return dwMaster["MEKEVARHNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKEVARHNR"] = value; OnPropertyChanged("MEKEVARHNR", value); } } //lENGth 2
                 public string MEKEVARUNR { get { if (dwMaster == null) return ""; return dwMaster["MEKEVARUNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKEVARUNR"] = value; OnPropertyChanged("MEKEVARUNR", value); } } //lENGth 2
                 public string MEKBNRKRS { get { if (dwMaster == null) return ""; return dwMaster["MEKBNRKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBNRKRS"] = value; OnPropertyChanged("MEKBNRKRS", value); } } //lENGth 2
                 public string MEKBLFDNR { get { if (dwMaster == null) return ""; return dwMaster["MEKBLFDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBLFDNR"] = value; OnPropertyChanged("MEKBLFDNR", value); } } //lENGth 4
                 public string MEKBPOS { get { if (dwMaster == null) return ""; return dwMaster["MEKBPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBPOS"] = value; OnPropertyChanged("MEKBPOS", value); } } //lENGth 2
                 public string MEKSTAKZ { get { if (dwMaster == null) return ""; return dwMaster["MEKSTAKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKSTAKZ"] = value; OnPropertyChanged("MEKSTAKZ", value); } } //lENGth 1
                 public double MEKUNKLARZL { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["MEKUNKLARZL"].ToString()); } set { if (dwMaster == null) return; dwMaster["MEKUNKLARZL"] = value; OnPropertyChanged("MEKUNKLARZL", value); } } //lENGth 0
                 public string MEKBEM1 { get { if (dwMaster == null) return ""; return dwMaster["MEKBEM1"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBEM1"] = value; OnPropertyChanged("MEKBEM1", value); } } //lENGth 50
                 public string MEKBEM2 { get { if (dwMaster == null) return ""; return dwMaster["MEKBEM2"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBEM2"] = value; OnPropertyChanged("MEKBEM2", value); } } //lENGth 50
                 public double MEKAENDZL { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["MEKAENDZL"].ToString()); } set { if (dwMaster == null) return; dwMaster["MEKAENDZL"] = value; OnPropertyChanged("MEKAENDZL", value); } } //lENGth 0
                 public string MEKAENDBEN { get { if (dwMaster == null) return ""; return dwMaster["MEKAENDBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKAENDBEN"] = value; OnPropertyChanged("MEKAENDBEN", value); } } //lENGth 8
                 public double MEKAENDDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["MEKAENDDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["MEKAENDDAT"] = value; OnPropertyChanged("MEKAENDDAT", value); } } //lENGth 0
                 public string MEKNEUBEN { get { if (dwMaster == null) return ""; return dwMaster["MEKNEUBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKNEUBEN"] = value; OnPropertyChanged("MEKNEUBEN", value); } } //lENGth 8
                 public double MEKNEUDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["MEKNEUDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["MEKNEUDAT"] = value; OnPropertyChanged("MEKNEUDAT", value); } } //lENGth 0
                 public string MEKVONMOD { get { if (dwMaster == null) return ""; return dwMaster["MEKVONMOD"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKVONMOD"] = value; OnPropertyChanged("MEKVONMOD", value); } } //lENGth 3
                 public string MEKBISMOD { get { if (dwMaster == null) return ""; return dwMaster["MEKBISMOD"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKBISMOD"] = value; OnPropertyChanged("MEKBISMOD", value); } } //lENGth 3
                 public string MEKWSCHLA { get { if (dwMaster == null) return ""; return dwMaster["MEKWSCHLA"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKWSCHLA"] = value; OnPropertyChanged("MEKWSCHLA", value); } } //lENGth 10
                 public string MEKFILLER { get { if (dwMaster == null) return ""; return dwMaster["MEKFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["MEKFILLER"] = value; OnPropertyChanged("MEKFILLER", value); } } //lENGth 10
        */
        #endregion
    }
} 

